/*
 * @Author: shanghongyun 2879455630@qq.com
 * @Date: 2025-05-28 13:33:33
 * @LastEditors: shanghongyun 2879455630@qq.com
 * @LastEditTime: 2025-06-12 09:16:26
 * @FilePath: \A05\User\Base.h
 * @Description: 基础运算及类型
 */
#ifndef __BASE_H_
#define __BASE_H_

#include "stdint.h"
#include "stdbool.h"
#include "stdio.h"


typedef uint32_t    u32;
typedef uint16_t    u16;
typedef uint8_t     u8 ;


typedef int32_t    s32;
typedef int16_t    s16;
typedef int8_t     s8 ;


#define MAX(a , b)              (((a) > (b)) ? (a) : (b))
#define MIN(a , b)              (((a) > (b)) ? (b) : (a))
#define LIMIT(x , low , up)      (((x) < (low)) ? (low) : (((x) > (up)) ? (up) : (x)))
#define SIGN(x)                 (((x) > 0) ? (x) : (-(x)))

#define _Q15(x)                 ((x) * 32768)
#define R_Q15(x)                ((x) / 32768)


#endif

